<div id="page_content">
<h1>Return Rent</h1>
<p id="notice"><%= notice %></p>
<p>
  <b>Customer:</b>
  <%= @rent.customer_id %>
</p>
<p>
  <b>Product:</b>
  <%= @rent.product_id %>
</p>
<p>
  <b>Date rented:</b>
  <%= @rent.date %>
</p>
<p>
  <b>Expected return:</b>
  <%= @rent.expected_return %>
</p>
<p>
  <b>Return date:</b>
  <%= DateTime.now %>
</p>

<table>
	<th>Day Charge</th>
	<th>Rented Days</th>
	<th>Overdue Days</th>
	<th>Deposit</th>
	<th>Rent Charge</th>
<tr>
  <td>
  	<%= @rent.day_charge %>
  </td>
  <td>
  	<%= @rent.rented_days(Time.current.to_date) %>
  </td>
  <td>
  	<%= @rent.overdue_days(Time.current.to_date) %>
  </td>
  <td>
  	<%= @rent.deposit %>
  </td>
  <td>
  	<%= number_to_currency(@rent.calculate_charge(Time.current.to_date)) %>
  </td>
</tr>
</table>
<%= link_to 'Cancel', rents_path %> |
<%= link_to 'Return', rent_returned_path(@rent.id) %>
</div>